//
//  JYTButton.m
//  JYT_IOS
//
//  Created by nxa-chengjinhui on 2017/1/12.
//  Copyright © 2017年 nxa-yuanguoxiang. All rights reserved.
//

#import "JYTButton.h"

@implementation JYTButton

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if ( self) {
        [self setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        self.titleLabel.font = [UIFont systemFontOfSize:14.0];
    }
    return self;
}

//
//- (void)layoutSubviews{
//}


// 设置button 的文字位置
- (CGRect)titleRectForContentRect:(CGRect)contentRect
{
    float x = contentRect.origin.x + contentRect.size.height-5;
    float y = contentRect.origin.y;
    float width = contentRect.size.width - contentRect.size.height/2;
    float height = contentRect.size.height;
    //NSLog(@"%f  %f  ",x,y);
    return CGRectMake(x, y, width, height);
}


// 设置button 的图片位置
- (CGRect)imageRectForContentRect:(CGRect)contentRect
{
    float x = contentRect.origin.x;
    float y = contentRect.origin.y+2;
    float width = contentRect.size.height-5;
    float height = contentRect.size.height-5;
    //NSLog(@"%f  %f  ",x,y);
    return CGRectMake(x, y, width, height);
}




@end
